package wwek6;


import java.util.Arrays;
import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		
		public PairResult() {
		}

		public PairResult(double min, double max) {
			this.min = min;
			this.max = max;
		}

		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}
	static PairResult findMinMax(double[] values) {
		Arrays.sort(values);
		PairResult result=new PairResult(values[0], values[values.length-1]);
		return result;
	}
}
public class PTA720404 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		double [] d = new double[n];
		for(int i = 0;i<n;i++)
			d[i]=in.nextDouble();
		System.out.println(ArrayUtils.findMinMax(d));
		System.out.println(ArrayUtils.PairResult.class);
	}

}
